package test.net
{
	import flash.display.BitmapData;
	import flash.display.Sprite;
	
	import level4.net.third_party_api.uploaders.RRAlbumUploader;
	import level4.net.third_party_api.renrenapi.RRMethods;
	import level4.net.third_party_api.renrenapi.RRSignatureStruct;
	import level4.net.third_party_api.renrenapi.RRURLS;
	
	public class RRtest
	{
		public function RRtest()
		{
			var sprite:Sprite = new Sprite();
				sprite.graphics.beginFill(0xff0000,0.5);
				sprite.graphics.drawCircle(0,0,15);
				sprite.graphics.endFill();
				
			var bmd:BitmapData = new BitmapData(sprite.width,sprite.height);
				bmd.draw(sprite);
			
			var struct:RRSignatureStruct = new RRSignatureStruct();
				struct.url = RRURLS.URL_PHOTO;
				struct.albumId = 472937676;
				struct.caption = "什么图片";
				struct.apiKey = "542c02433f124b77bd43dc37d0670678";
				struct.secretKey = "b759a5a2b4444fe5b54e2def96887b8a";
				struct.sessionKey = "2.c7650faea03cc538f03f593eb8d18ef4.3600.1309611600-348186778";
				struct.method = RRMethods.PHOTOS_UPLOAD;
			
			var uploader:RRAlbumUploader = new RRAlbumUploader();
				uploader.uploadPhoto(struct,"fileName.jpg",bmd);
				uploader.onOk = function(resp:String):void{
					trace(resp)
				}
		}
	}
}